package com.baidu.project15.chart15;

import java.util.ArrayList;
public class Branch extends AbstractBranch{
    private ArrayList<AbstractBranch>list;
    private String name;
    public Branch(String name) {
        this.name = name;
    }
    public void receiveDoc() {
        System.out.println(name+"收到文件");
    }
    public AbstractBranch getChild(int n) {
        return list.get(n);
    }
    public void add(AbstractBranch abBranch) {
        list.add(abBranch);
    }
    public void remove(AbstractBranch abBranch) {
        list.remove(abBranch);
    }
    public String getName() {
        return name;
    }
    public void sendDoc(AbstractBranch abBranch) {
        System.out.println(name+ "发送文件到"+abBranch.getName());
        abBranch.receiveDoc();
    }
}